package com.Cheng.service;

import com.Cheng.dao.IncomeMapper;
import com.Cheng.pojo.Income;

import java.util.List;

/**
 * @Author Cheng
 * @Date 2022/4/10 15:54
 * service的impl是把mapper和service进行整合的文件。
 */
public class IncomeServiceImpl implements IncomeService{
    //Service调用dao层：组合Dao
    private IncomeMapper incomeMapper;

    public void setIncomeMapper(IncomeMapper incomeMapper) {
        this.incomeMapper = incomeMapper;
    }

    @Override
    public int addIncome(Income income) {
        return incomeMapper.addIncome(income);
    }

    @Override
    public int deleteIncomeById(int id) {
        return incomeMapper.deleteIncomeById(id);
    }

    @Override
    public int updateIncome(Income income) {
        return  incomeMapper.updateIncome(income);
    }

    @Override
    public Income queryIncomeById(int id) {
        return incomeMapper.queryIncomeById(id);
    }

    @Override
    public List<Income> queryAllIncome() {
        return incomeMapper.queryAllIncome();
    }
}
